var shar;
Page({
  data: {
    unionid:'',
    strWxFan:'',
    logs: []
  },
  onLoad: function () {
    wx.request({
      url: 'https://wwcxc.arksh.com/api/xcx/getsha',
      data: {
        nid: 35
      },
      success: function (res) {
        console.log(res.data)
        var types = res.data.data
        for (var i = 0; i < types.length; i++) {
          var ty = types[i].type;
          if (ty ==1) {
            shar = types[i];
          }
        }
      }
    })
    var that = this;
    //获取缓存中的unionid、openid
      var value = wx.getStorageSync("userInfo");
    if (!value) {
      wx.reLaunch({
        url: '/pages/index2/index2'
      })
    }
      console.log(value.unionid);
      wx.request({
        url: 'https://wwcxc.arksh.com/api/xcx/getusreifo',
        data: {
          unionid: value.unionid
        },
        success: function (res) {
          console.log(res);
          that.setData({
            unionid: value.unionid,
            strWxFan: res.data
          })
        }
      })

  },
  /**
  * 用户点击右上角分享
  */
  onShareAppMessage: function () {
    return {
      title: shar.title,
      desc: shar.remark,
      imageUrl: shar.img
    }
  }
})